package core 
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author Kylin206
	 */
	public class UpdatableItem extends MovieClip 
	{
		private var isUpdata:Boolean = false;//已经升级
		
		public function UpdatableItem() 
		{
			this.addEventListener(Event.ADDED_TO_STAGE, onAdded);
			stop();
		}
		
		private function onAdded(e:Event):void 
		{
			stage.addEventListener(MouseEvent.CLICK, onStageClicked);
			
			removeEventListener(Event.ADDED_TO_STAGE, onAdded);
		}
		
		private function onStageClicked(e:MouseEvent):void 
		{
			if (isUpdata)
			{
				isUpdata = false;
				this.gotoAndStop(1);
			}
			else
			{
				isUpdata = true;
				this.gotoAndStop(2);
			}
		}
		
	}

}